<template>
  <svg aria-hidden="true" :width="width" :height="height">
    <use :href="symbolId" :fill="color" />
  </svg>
</template>

<script setup lang="ts">
const props = defineProps({
  prefix: {
    type: String,
    default: 'icon'
  },
  name: {
    type: String,
    required: true
  },
  color: {
    type: String,
    default: '#333'
  },
  size: {
    type: Number,
    default: 16
  }
  //   width: {
  //     type: String,
  //     default: '16px'
  //   },
  //   height: {
  //     type: String,
  //     default: '16px'
  //   }
})
const symbolId = computed(() => {
  return `#${props.prefix}-${props.name}`
})
const width = computed(() => `${props.size}px`)
const height = computed(() => `${props.size}px`)
</script>

<style scoped></style>
